body, html {
    height: 100%;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f4f9;
}

.container {
    display: flex;
    height: 100%;
}

#chat-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    max-width: calc(100% - 270px);
}

#chat-box {
    flex-grow: 1;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    background-color: #fff;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
}

.message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    max-width: 90%;
    word-wrap: break-word;
    line-height: 1.6;
}

.user-message {
    background-color: #dcf8c6;
    align-self: flex-end;
    margin-left: auto;
}

.assistant-message {
    background-color: #f1f0f0;
    align-self: flex-start;
}

.assistant-message pre {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
    white-space: pre-wrap;
}

.assistant-message code {
    font-family: 'Courier New', Courier, monospace;
}

#input-area {
    display: flex;
    align-items: center;
}

#message-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    resize: none;
    margin: 0 10px;
    font-size: 1em;
}

#send-btn, #upload-btn {
    padding: 10px 15px;
    border: none;
    background-color: #007bff;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
}

#send-btn:hover, #upload-btn:hover {
    background-color: #0056b3;
}

#settings-panel {
    width: 250px;
    flex-shrink: 0;
    padding: 10px;
    border-left: 1px solid #ccc;
    background-color: #fafafa;
}

#settings-panel h3 {
    margin-top: 0;
}

#settings-panel label, #settings-panel input {
    display: block;
    width: calc(100% - 20px);
    margin-bottom: 10px;
}

#settings-panel input {
    padding: 8px;
}

/* --- 核心修正：视觉渲染容器样式 --- */
.visual-container {
    background-color: #ffffff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    margin: 10px 0;
    overflow: auto;
}

.mermaid-graph {
    text-align: center;
}

.mermaid-graph svg {
    max-width: 100%;
    height: auto;
}

.positional-graphic {
    border: 1px dashed #a0a0a0;
    min-height: 200px; /* 确保即使内容少也有一个可见的画布 */
}

.positional-text {
    padding: 10px;
    border-radius: 5px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    overflow-wrap: break-word;
    display: flex; /* 用于垂直居中 */
    align-items: center;
    justify-content: center;
}

.error-box {
    color: #b91c1c;
    background-color: #fee2e2;
    border: 1px solid #fca5a5;
    padding: 15px;
    border-radius: 4px;
}

/* --- 从API响应中提取的动态样式 --- */
.bg-green { background-color: #e7f4e8; border-color: #a7d7a9; }
.bg-purple { background-color: #f0eafa; border-color: #c9b2e1; }
.bg-yellow { background-color: #fff8e1; border-color: #ffecb3; }
.font-white { color: white; }
.font-size-medium { font-size: 1.1em; }
.border-blue { border: 2px solid #90caf9; }
.border-green { border: 2px solid #a5d6a7; }
.border-yellow { border: 2px solid #fff59d; }
.shape-rectangle { border-radius: 4px; }
.shape-circle { border-radius: 50%; }
.horizontal-centered { justify-content: center; }
.vertical-centered { align-items: center; }
